package cz.none.bezbarier.web.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import cz.none.bezbarier.web.form.UserControllForm;
import cz.none.bezbarier.web.form.UserForm;
import cz.none.bezbarier.web.model.User;

/**
 * Service class for Users
 *
 * @author masoukup
 *
 */
@Transactional
public interface UserService extends BaseService<UserForm, User, String> {
	/**
	 * Returns all users.
	 *
	 * @return users
	 */
	@Transactional(readOnly = true)
	public List<User> getAllUsers();

	/**
	 * Updates user according {@link UserControllForm} It serves for setting of
	 * user authorization
	 *
	 * @param form
	 */
	public void updateUser(UserControllForm form);

	/**
	 * Registers new user.
	 *
	 * @param user
	 */
	public void registerUser(UserForm user);

	/**
	 * Deletes user with specified ID
	 *
	 * @param userId
	 */
	public boolean deleteUser(String userId);

	/**
	 * Returns current logged in user.
	 *
	 * @return user
	 */
	@Transactional(readOnly = true)
	public User getCurrentUser();
}
